/**
 * 
 */
package exceptions;

import data.ReturnValue;

/**
 * @author sebastian
 *
 */
public final class DetailedReturnException extends ReturnException {
	private static final long serialVersionUID = 4470897801105180254L;
	
	private final ReturnValue[] detail;

	public DetailedReturnException(ReturnValue r, ReturnValue[] detail) {
		super(r);
		
		this.detail = detail;
	}

	@Override
	public String getMessage() {
		String result = super.getMessage();
		for (int i=0; i<detail.length; i++)
			result += "\n" + detail[i].message;
		
		return result;
	}
}
